package main

import (
	"go.uber.org/zap"
	"superTools-backend/pkg/logging"
	"superTools-backend/services/apigw/route"
)

/**
* @Author: super
* @Date: 2020-08-21 21:44
* @Description:
**/

func main() {

	//endless.DefaultReadTimeOut = watchConfig.Server.ReadTimeout
	//endless.DefaultWriteTimeOut = watchConfig.Server.WriteTimeout
	//endless.DefaultMaxHeaderBytes = 1 << 20
	//endPoint := fmt.Sprintf(":%d", watchConfig.Server.HttpPort)
	//
	//server := endless.NewServer(endPoint, route.Router())
	//server.BeforeBegin = func(add string) {
	//	logging.GetLogger().Info("Actual pid", zap.Int("pid", syscall.Getpid()))
	//}
	//
	//err := server.ListenAndServe()
	//if err != nil {
	//	logging.GetLogger().Error("server error", zap.Error(err))
	//}

	r := route.Router()
	err := r.Run(":8080")
	if err != nil{
		logging.GetLogger().Error("route run", zap.Error(err))
	}
}